package com.zqx.mediator.abstractcomponent;

import com.zqx.mediator.abstractmediator.Mediator;

/**
 * description: 抽象组件类；抽象同事类
 * @author zqx
 * @date 2018/09/04
 */
public abstract class Component {

    protected Mediator mediator;

    public void setMediator(Mediator mediator) {
        this.mediator = mediator;
    }

    //转发调用
    public void changed(){
        mediator.componentChanged(this);
    }

    public abstract void update();
}
